package Gui;

import java.awt.Color;

import javax.swing.JPanel;
import javax.swing.JLabel;
import java.awt.Font;
import javax.swing.JButton;

import Logic.LoginInfo;
import client.LibaryMain;

import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import java.util.ArrayList;
import javax.swing.ImageIcon;

/**
 * this class implements gui lending report window
 * @author Ron Shenkerman
 * @author Gabi Revah
 * @author Aviad Almog
 * @author Ivan Onyshchenko
 */
public class LendingReport extends JPanel{

	
	public LendingReport() {
		
		initcomponents();
	
	}
/**
 * this method initilize the lending window 
 */
	public void initcomponents()
	{
	setBackground(new Color(153, 204, 255));
	setSize(1000,710);
	setLayout(null);
	
	JLabel lblLendingReport = new JLabel("Lending Report ");
	lblLendingReport.setFont(new Font("Tahoma", Font.BOLD | Font.ITALIC, 26));
	lblLendingReport.setBounds(70, 53, 208, 25);
	add(lblLendingReport);
	
	JButton btnBack = new JButton("Back");
	btnBack.addActionListener(new ActionListener() {
		public void actionPerformed(ActionEvent e) {
			
			MainScreen.cardLayot.show(MainScreen.card, "reportmenu");
		}
	});
	btnBack.setFont(new Font("Tahoma", Font.BOLD | Font.ITALIC, 13));
	btnBack.setBounds(159, 581, 97, 25);
	add(btnBack);
	
	JButton btnLogout = new JButton("Logout");
	btnLogout.addActionListener(new java.awt.event.ActionListener() {      
        public void actionPerformed(java.awt.event.ActionEvent ev) {
        	btnLogOut(ev);				
		}
        
		private void btnLogOut(ActionEvent ev) {
			ArrayList<String> Arr=new ArrayList<String>();
			Arr.add("Logout");
			Arr.add("Worker");
			Arr.add(LoginInfo.UserName);
			LibaryMain.chat.handleMessageFromGui(Arr);
			MainScreen.cardLayot.show(MainScreen.card, "Login");
			
		}
    });
	btnLogout.setFont(new Font("Tahoma", Font.BOLD | Font.ITALIC, 13));
	btnLogout.setBounds(850, 581, 97, 25);
	add(btnLogout);
	
	JLabel label = new JLabel("");
	label.setIcon(new ImageIcon(LendingReport.class.getResource("/Gui/images/statistics (1).png")));
	label.setBounds(291, 332, 533, 302);
	add(label);
	}	
	
	
	
	
	
	
}
